package com.newcoder.leetcode;

import java.util.Arrays;

public class String_firstUniqChar {

    public static void main(String[] args) {
        int resut = new String_firstUniqChar().firstUniqChar("Z");
        System.out.println(resut);
    }

    public int firstUniqChar(String s) {
        for (int i = 0; i < s.length(); i++){
            if (s.indexOf(s.charAt(i)) == s.lastIndexOf(s.charAt(i))){
                return i;
            }
        }
        return -1;
    }
}
